/*
 * mail.cpp
 *
 *  Created on: Dec 12, 2013
 *      Author: killerg
 */


#include "auth_deps.h"
#include "auth.h"

#include <google/protobuf/stubs/common.h>

#include "share/util.h"

void run(SvcData* svcdata_) {
    srand(time(NULL));

    svcdata_->status = SvcData::Initing;
	if (!g_auth.init(svcdata_)) {
    	svcdata_->status = SvcData::Shutting;
		return ;
	}
	svcdata_->status = SvcData::Running;
	g_auth.update();
	svcdata_->status = SvcData::Shutting;
	g_auth.destroy();

    google::protobuf::ShutdownProtobufLibrary();
}

int main(int argc, char** argv) {
	return svc_ctrl(argc, argv, run)?0:-1;
}
